﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XCommunity.Documents.UBB
{

  /// <summary>
  /// UBB文档适配器，提供UBB标签的描述和渲染方式
  /// </summary>
  public class UbbProvider
  {




    private Dictionary<string, UbbTagKind> tagKinds = new Dictionary<string, UbbTagKind>()
    {
      { "img", UbbTagKind.ChildAsArgument },
      { "style", UbbTagKind.BlockWithArgument },
      { "p", UbbTagKind.BlockWithArgument },
      { "b", UbbTagKind.BlockWithoutArgument },
      { "link", UbbTagKind.BlockWithArgument }
    };

    public virtual UbbTagKind GetKind( string tagName )
    {
      UbbTagKind kind;
      if ( tagKinds.TryGetValue( tagName, out kind ) )
        return kind;
      else
        return null;
    }





    private static UbbProvider _provider = new UbbProvider();

    public static UbbProvider GetProvider()
    {
      return _provider;
    }

  }
}
